package com.jr.dao;

import com.jr.entity.Order;

import java.util.List;

public interface OrderDao {
    /**
     * 根据ID查询所有订单
     * @param enterpriseId
     * @return
     * @throws Exception
     */
    List<Order> listAllOrder(Integer enterpriseId)throws Exception;

    /**
     * 根据企业id获得所有订单
     * @param enterpriseId
     * @return
     * @throws Exception
     */
    long getTotal(Integer enterpriseId) throws Exception;

    /**
     * 根据企业id和开始页进行数据的分页展示
     * @param enterpriseId
     * @param start
     * @param pageSize
     * @return
     * @throws Exception
     */
    List<Order> findOrder(Integer enterpriseId, int start,int pageSize) throws Exception;

    /**
     * 根据订单编号删除订单
     * @param no
     * @return
     * @throws Exception
     */
    int deleteOrder(String no)throws Exception;

    /**
     * 根据发票id查找所有订单
     * @param invoiceId
     * @return
     * @throws Exception
     */
    List<Order> invoiceOrder(Integer invoiceId)throws Exception;

    /**
     * 根据发票id计算开票总金额
     * @param invoiceId
     * @return
     * @throws Exception
     */
    Double TotalAmount(Integer invoiceId)throws Exception;

    /**
     * 订单总金额
     * @return
     * @throws Exception
     */
    Double sumAmount()throws Exception;

    /**
     * 根据开票状态计算订单总和
     * @param invoiceStatus
     * @return
     * @throws Exception
     */
    Double finishSumAmount()throws Exception;

    /**
     * 根据订单编号更新订单
     * @param no
     * @return
     * @throws Exception
     */

    int updateOrder(String no)throws Exception;

    /**
     * 根据订单编号更新发票id
     * @param no
     * @return
     * @throws Exception
     */
    int updateStatus(String no)throws Exception;

    /**
     * 根据发票id进行退票
     * @param invoiceId
     * @return
     * @throws Exception
     */
    int refundTicket(Integer invoiceId)throws Exception;

}
